spb/tools-spboucher-ai
Public
1import { requireUser, jsonError } from "@/lib/auth/guard";2import { retry, cancel } from "@/lib/jobs/queue";3export async function POST(req: Request, { params }: { params: Promise<{ id: string }> }) {4 try { await requireUser(req); const id = Number((await params).id); const { action } = await req.json(); if (action === "retry") await retry(id); else if (action === "cancel") await cancel(id); return Response.json({ ok: true }); } catch (e) { return jsonError(e); }5}6